package com.htpro.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.htpro.mapper.UserMapper;
import com.htpro.pojo.User;
import com.htpro.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper um;

    @Override
    public List<User> getAllUsers() {
        return um.selectList(null);
    }

    @Override
    public User getOneUser(String username,String pwd) {
        QueryWrapper qw = new QueryWrapper();
        qw.eq("username",username);
        qw.eq("pwd",pwd);
        return um.selectOne(qw);
    }
}
